package com.test.demo;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * @author DouWeiWei
 * @createTime 2020年07月22日 11:31:00
 */
public class ha {
//    public static void main(String[] args) {
////        int num1 = 23;
////        int num2 = 34;
////        System.out.println("n1的值是:" + num1 + ",n2的值是:" + num2);
////        swap(num1, num2);
////        System.out.println("交换后n1的值是:" + num1 + "，num2的值是:" + num2);
////    }
////
////    public static void swap(int n1, int n2) {
////        int temp = n1;
////        n1 = n2;
////        n2 = temp;
////    }
//    }
public static void main(String args[]) throws IOException {
    char c;
    // 使用 System.in 创建 BufferedReader
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    System.out.println("输入字符, 按下 'q' 键退出。");
    // 读取字符
    do {
        c = (char) br.read();
        System.out.println(c);
    } while (c != 'q');
}
}
